﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>@ViewBag.Title</title>
    <script src="~/miniui_net/scripts/boot.js" type="text/javascript"></script>
    <link href="~/miniui_net/res/third-party/scrollbar/jquery.mCustomScrollbar.css" rel="stylesheet" type="text/css" />
    <script src="~/miniui_net/res/third-party/scrollbar/jquery.mCustomScrollbar.concat.min.js" type="text/javascript"></script>
    <link href="~/miniui_net/frame/frame1/res/menu/menu.css" rel="stylesheet" type="text/css" />
    <script src="~/miniui_net/frame/frame1/res/menu/menu.js" type="text/javascript"></script>
    <script src="~/miniui_net/frame/frame1/res/menutip.js" type="text/javascript"></script>
    <link href="~/miniui_net/frame/frame1/res/tabs.css" rel="stylesheet" type="text/css" />
    <link href="~/miniui_net/frame/frame1/res/frame.css" rel="stylesheet" type="text/css" />
    <link href="~/miniui_net/frame/frame1/res/index.css" rel="stylesheet" type="text/css" />  
</head>
<body>
    <div class="navbar">
        <div class="navbar-header">
            <div class="navbar-brand">东风柳汽平台管理</div>
            <div class="navbar-brand navbar-brand-compact">M</div>
        </div>
        <ul class="nav navbar-nav">
            <li><a id="toggle"><span class="fa fa-bars"></span></a></li>
        </ul>
        <ul class="nav navbar-nav navbar-right">
            <li><a href="#"><i class="fa fa-pencil-square-o"></i> 修改密码</a></li>
            <li><a href="#"><i class="fa fa-user"></i> 退出登录</a></li>
        </ul>
    </div>
    <div class="container">
        <div class="sidebar">
            <div class="sidebar-toggle"><i class="fa fa-fw fa-dedent"></i></div>
            <div id="mainMenu"></div>
        </div>
        <div class="main">
            <div id="mainTabs" class="mini-tabs main-tabs" activeIndex="0" style="height:100%;" plain="false"
                 buttons="#tabsButtons" arrowPosition="side">
                <div name="index" title="系统简介">
                    @RenderBody()
                </div>
            </div>
        </div>
    </div>
</body>
</html>
<script>
    function activeTab(item) {
        var tabs = mini.get("mainTabs");
        var tab = tabs.getTab(item.id);
        if (!tab) {
            tab = { name: item.id, title: item.text, url: item.url,showCloseButton: true };
            tab = tabs.addTab(tab);
        }
        tabs.activeTab(tab);
    }

    $(function () {
        //menu
        var menu = new Menu("#mainMenu", {
            itemclick: function (item) {
                if (item.url!=null) {
                    activeTab(item);
                }
            }
        });
      
        new MenuTip(menu);

        $.ajax({
            url: "/Home/GetMenuList",
            success: function (text) {
                var data = mini.decode(text);
                menu.loadData(data);
            }
        })
        //toggle
        $("#toggle, .sidebar-toggle").click(function () {
            $('body').toggleClass('compact');
            mini.layout();
        });

        //dropdown
        $(".dropdown-toggle").click(function (event) {
            $(this).parent().addClass("open");
            return false;
        });

        $(document).click(function (event) {
            $(".dropdown").removeClass("open");
        });
    });
</script>
